
k=100;
n=15;


r9=0;
r8=0;
r7=0;
r6=0;
r5=0;
r4=0;
r3=0;
r2=0;
r1=0;

input=zeros(k);
input(1)=-128;
input(2:3)=127;
input(4:6)=-128;
input(7:8)=127;
input(9)=-128;


at=[ 0.026748757411, ...
   -0.016864118443, ...
   -0.078223266529, ...
    0.266864118443, ...
    0.602949018236, ...
    0.266864118443, ...
   -0.078223266529, ...
   -0.016864118443, ...
    0.026748757411]; 

a=(at*2^15);

for i=1:k
    
    r9=r8;
    r8=r7;
    r7=r6;
    r6=r5;
    r5=r4;
    r4=r3;
    r3=r2;
    r2=r1;
    r1=input(i);
    
    output(i)= a(1)*r1 + a(2)*r2 + a(3)*r3 + a(4)*r4 + a(5)*r5 + a(6)*r6 + a(7)*r7 + a(8)*r8 + a(9)*r9;
    output(i)=(output(i)/(2^n));
end


